import psutil

# #网络IO信息获取
# net_io = psutil.net_io_counters()
# print(f"发送字节数:{net_io.bytes_sent},"
#       f"接收字节数:{net_io.bytes_recv}")

# 获取网络接口信息
net_if_addrs = psutil.net_if_addrs()
for interface ,address in net_if_addrs.items():
      for addr in address:
          print(f"接口名称:{interface},"
                f"地址类型:{addr.family},"
                f"地址:{addr.address}")